#!/usr/bin/env python
# -*- coding: utf-8 -*-

# @Time     :2020/11/12
# @Author   :Changshu
# @File     :Exercise_434.py
# 434. 字符串中的单词数

# def countSegments(s: str) -> int:
# 	count=0
# 	i,n=0,len(s)
# 	while i<n:
# 		if 65 <= ord(s[i]) <= 90 or 97 <= ord(s[i]) <= 122 or ord(s[i])==39:
# 			count+=1
# 			while i<n and (65 <= ord(s[i]) <= 90 or 97 <= ord(s[i]) <= 122 or ord(s[i])==39):
# 				i+=1
# 		else:
# 			while i<n and (ord(s[i]) < 65 or 90 < ord(s[i]) < 97 or ord(s[i]) > 122) and ord(s[i])!=39:
# 				i+=1
#
# 	return count

def countSegments(s: str) -> int:
	return len(s.split( ))

if __name__ == '__main__':
	# s='Hello, my name is John'		#5
	# s = "The one-hour drama series Westworld is a dark odyssey about the dawn of artificial consciousness and the evolution of sin. Set at the intersection of the near future and the reimagined past, it explores a world in which every human appetite, no matter how noble or depraved, can be indulged."
	s=''
	print(countSegments(s))